Upgrade tests to JUnit 6 - #652
Conversation
| testImplementation(libs.junit) | ||
| testImplementation(platform(libs.junit.bom)) | ||
| testImplementation(libs.googleTruth) { | ||
| exclude(group = "junit", module = "junit") |
There was a problem hiding this comment.
See google/truth#333 and https://github.com/google/truth/blob/18fafefc293fd624a5291cda8da42356401650eb/core/src/main/java/com/google/common/truth/Platform.java#L264-L280
My suggestion is to get rid of Truth to moment we have any JUnit4/linkage errors in the build
There was a problem hiding this comment.
My suggestion is to just get rid of it. As far as I can see, there is nothing specific about its usage. All tests can use default JUnit assertions
| gson = { module = "com.google.code.gson:gson", version.ref = "com-google-code-gson-gson" } | ||
| guava = { module = "com.google.guava:guava", version.ref = "com-google-guava-guava" } | ||
| junit = { module = "junit:junit", version.ref = "junit-junit" } | ||
| junit-bom = { module = "org.junit:junit-bom", version.ref = "org-junit-junit-bom" } |
There was a problem hiding this comment.
If you are puzzled by the convention between dashes and camel case, it makes two of us now: https://docs.gradle.org/current/userguide/best_practices_dependencies.html#name_version_catalog_entries
|
My only concern with this approach to test generation is that it is very inconvenient for debugging individual test cases: you have to add conditional filtering in the factory to run a single test that you are interested in. My original idea was to replicate the approach from the compiler, I even had a prototype that does it. Maybe we can adapt something like this? |
|
@AbdullinAM do you mean from Gradle and/or - |
Also, get rid of kotlin-test in core, it's now redundant
This is presumably safe due to google/truth@948f3ed
A few notes:
This is a basis for the next PR with tests revamp (and it's more pleasant to do it with JUnit 6 + it's always nice to renovate things) and a nice testing ground for stacked PRs